import React from 'react';

// 导入需要的页面组件
import Home from './pages/Home'
import CityList from './pages/CityList'


// 按需导入要用的组件
// import { Button } from 'antd-mobile'

// 导入路由需要的组件
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'


function App() {
  return (
    <Router>
      <div className="App">
        {/* 配置导航菜单 */}
        {/* <ul><li><Link to="/home">首页</Link></li><li><Link to="/citylist">城市列表</Link></li></ul> */}
        {/* 路由重定向 */}
        <Route exact path="/" render={() => <Redirect to="/home" />} />

        {/* 配置路由 */}
        {/* home组件是父路由内容 */}
        <Route path="/home" component={Home}></Route>
        <Route path="/citylist" component={CityList}></Route>
      </div>
    </Router>
  );
}

export default App;
